package com.jar.exercise.集合和数据结构.arrayList的底层实现;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * 检测Arralist中使用for循环能不能删除干净
 */
public class Demo1 {

	public static void main(String[] args) {
		List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 1, 5, 4, 5, 2, 4141, 2, 5);
		Iterator<Integer> iterator = integers.iterator();
		while (iterator.hasNext()) {
			iterator.remove();
		}
		System.out.println(integers.size());
	}
}
